package exceptionlearn;

import accesscontrol.ArrayList;

public class MyException extends Exception {
    private static final long serialVersionUID = -3042686055658047285L;
	private Throwable _cause;	
	public MyException(Throwable cause,String message){
		super(message);
		this._cause = cause;	
	}
	public MyException(Throwable cause){
		super(cause.getMessage());
		this._cause = cause;
	}
	public MyException(){
//		super("test");
		this._cause = null;
	}
    public final void printStackTrace() {
        printStackTrace(System.err);
    }
    public void test()throws NullPointerException{
//    	throw new NullPointerException();
    	throw new NullPointerException();
    }
    public void test3(){
    	test();
    	System.out.println("test3 continue ");
    }
    public void test4(){
    	try{
    	test3();}catch(NullPointerException e){
    		
    	}finally{
    	System.out.println("test4 continue ");}
    }
    public void test(java.util.ArrayList i){
    	i.add("hello");
    	System.out.println(i);
    }
    public void test2()throws Exception{
    	
    }

}
